﻿{% extends "base.html" %}
{% block title %}Admin Page{% endblock %}

{% block head %}
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    function clear(model){
        $.get("/admin/clear/?model="+model,
            function(data){
                if(data && parseInt(data)>0){
                    $('#log').append('<li>delete ' + model + ' for ' + data + ' records!</li>')
                    clear(model);
                }else{
                    $('#log').append('<li>done!</li>')
                }
            }
        );
    }
    $('input[type="button"]').click(function(){
        clear($(this).attr('model'));
        //alert($(this).attr('id'))
    });
});
</script>
{% endblock %}

{% block main %}
<div class="g960" style="height:100px;vertical-align:middle;">
    <div>
        <ul>
            <li><input type="button" id="clear" model="SongTasteSong" value="Clear SongTasteSong Data" title="Clear SongTasteSong Data"/></li>
            
        </ul>
    </div>
    
    <div>
    <ul id="log">
    </ul>
    </div>
</div>
{% endblock %}